#pragma once
#include "FWGame.h"
#include <dinput.h>
#define BUFFER_SIZE 1024
class FWGame;
class FWKeyboard
{
protected:
	FWGame* _gameObject;
	LPDIRECTINPUT8 di8;
	LPDIRECTINPUTDEVICE8 did8;
	char buffer_key[256];
	char buffer_key_old[256];
	HINSTANCE hInstance;
	HWND hWnd;
	DIDEVICEOBJECTDATA _keyEvent[BUFFER_SIZE];
	DWORD dwElements;
public:
	FWKeyboard(FWGame* game);
	bool init();
	void getState();
	bool isKeyDown(int key);
	bool isPreKeyDown(int key);
	bool isKeyRelease(int key);
	bool isKeyPressed(int key);
	void saveState();
	~FWKeyboard(void);
};

